/*
** strace.h for  in /home/lund/Projets/SysUnixAv/seutrace
** 
** Made by florian dewulf
** Login   <dewulf_f@epitech.net>
** 
** Started on  Tue Apr 30 14:57:20 2013 florian dewulf
** Last update Fri May 17 17:45:10 2013 kevin lansel
*/

#ifndef		STRACE_H__
# define	STRACE_H__

/*
** Include
*/

#include	<sys/user.h>

/*
** Data
*/

typedef struct		s_ptr_func
{
  int			type;
  void			(*func)(unsigned long long, int);
}			t_ptr_func;

typedef struct	s_syscall
{
  int	id;
  int	value_ret;
  char	*name;
  int	arg[7];
}		t_syscall;

enum {
  VOID,
  PTR,
  INT,
  CHAR,
  LONG,
  U_INT,
  U_CHAR,
  U_LONG,
  STRING,
};

typedef unsigned int	u_int;

/*
** Prototype
*/

char		*append(char *, char *);
u_int		count_word(char *);
void		epurspace(char *);
char		**strtowordtab(char *);
int		end_str(char *);

void		loop_ptr_func(unsigned long long *, t_syscall *,
			      struct user_regs_struct *, int);

void		strace_arg(char *);
void		strace_noarg(char *);

int		is_syscall(unsigned long long);
int		size_tab(int *);
t_syscall	which_syscall(unsigned long long);
void		*xmalloc(int);
void		fill_tab(unsigned long long *, t_syscall *,
			 struct user_regs_struct *);

#endif		/* strace.h */
